﻿@model Solution.Business.Entities.Transaction

@{
    ViewBag.Title = "Edit";
    Layout = "~/Views/Shared/_LayoutAdmin.cshtml";
}

<h2>Edit</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm("Edit", "AdminTransaction", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Transaction</legend>

        @Html.HiddenFor(model => model.TrId)

        <div class="editor-label">
            @Html.LabelFor(model => model.Name, "Tên loại giao dịch :")
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Name)
            @Html.ValidationMessageFor(model => model.Name)
             <span style="color:red;">*</span>
        </div>

         <div class="editor-label">
            @Html.LabelFor(model => model.TrGroup, "Nhóm chung loại giao dịch :")
        </div>
        <div class="editor-field">
        <select id="TrGroup" name="TrGroup">
            @if(Model.TrGroup == 1){
		        <option value="1" selected>Nhóm Bán/Mua</option>
		        <option value="2">Nhóm Cho thuê/Cần thuê</option>	
         }
         else
         {	
		        <option value="0">Nhóm Bán/Mua</option>	
		        <option value="1" selected>Nhóm Cho thuê/Cần thuê</option>
	        }
        </select>
             <span style="color:red;">*</span>
        </div>
        <div class="editor-label">
            @Html.LabelFor(model => model.Level, "Level :")
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Level)
            @Html.ValidationMessageFor(model => model.Level)
             <span style="color:red;">*</span>
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.TrGroup2, "Nhóm riêng loại giao dịch :")
        </div>
        <div class="editor-field">
            <select id="TrGroup2" name="TrGroup2">
            @if(Model.TrGroup2 == 1){
		        <option value="1" selected>Nhóm Bán BĐS</option>
                <option value="2">Nhóm Mua BĐS</option>
		        <option value="3">Nhóm Cho Thuê BĐS</option>
                <option value="4">Nhóm Cần Thuê BĐS</option>	
         }
         else if(Model.TrGroup2 == 2)
         {	
		        <option value="1">Nhóm Bán BĐS</option>
                <option value="2" selected>Nhóm Mua BĐS</option>
		        <option value="3">Nhóm Cho Thuê BĐS</option>
                <option value="4">Nhóm Cần Thuê BĐS</option>
            }
            else if (Model.TrGroup2 == 3)
            { 
                <option value="1">Nhóm Bán BĐS</option>
                <option value="2">Nhóm Mua BĐS</option>
		        <option value="3" selected>Nhóm Cho Thuê BĐS</option>
                <option value="4">Nhóm Cần Thuê BĐS</option>
            }
            else if (Model.TrGroup2 == 4)
            { 
                <option value="1">Nhóm Bán BĐS</option>
                <option value="2">Nhóm Mua BĐS</option>
		        <option value="3">Nhóm Cho Thuê BĐS</option>
                <option value="4" selected>Nhóm Cần Thuê BĐS</option>
            }
        </select>
             <span style="color:red;">*</span>
        </div>

        <p>
            <input type="submit" value="Save" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>
